<?php
/*
 * 类型管理
 * @arrange Mark
 * @package ixdcw
 * @file    type.inc.php
 * @time    12-12-19 上午10:30
 */
defined('IN_IXDCW') or exit('Access Denied');
isset($item) or msg();
require DT_INC.'/type.class.php';
$forward = '?file='.$file.'&item='.$item;
$do = new dtype;
$do->item = $item;
$do->cache = 1;
$menuon = 1;
$serviceCats = get_maincat(20, 4);
$serviceCatids = array_keys($serviceCats);
if(strpos($item, 'special-') === false) {
	switch($item) {
		case 'mail':
			$menus = array (
				array('邮件订阅', '?moduleid=2&file='.$item),
				array('订阅分类', $forward),
			);
		break;
		case 'announce':
			$menus = array (
				array('公告管理', '?moduleid=3&file='.$item),
				array('公告分类', $forward),
			);
		break;
		case 'link':
			$menus = array (
				array('友情链接', '?moduleid=3&file='.$item),
				array('链接分类', $forward),
			);
		break;
		case 'vote':
			$menus = array (
				array('投票管理', '?moduleid=3&file='.$item),
				array('投票分类', $forward),
			);
		break;
		case 'poll':
			$menus = array (
				array('票选管理', '?moduleid=3&file='.$item),
				array('票选分类', $forward),
			);
		break;
		case 'gift':
			$menus = array (
				array('积分换礼', '?moduleid=3&file='.$item),
				array('礼品分类', $forward),
			);
		break;
		case 'survey':
			$menus = array (
				array('问卷管理', '?moduleid=3&file='.$item),
				array('问卷分类', $forward),
			);
		break;
		case 'industry':
			$menus = array (
				array('行业圈分类', $forward),
			);
			$menuon = 0;
			break;
		case 'ad_place':
			$menus = array(
				array('添加广告位', '?moduleid=3&file=type&action=add_place'),
				array('广告位管理', '?moduleid=3&file=type'),
				array('广告管理', '?moduleid=3&file=type&action=list'),
				array('广告审核', '?moduleid=3&file=type&action=list&job=check'),
				array('更新广告', '?moduleid=3&file=type&action=html'),
				array('广告分类', '?file=type&item=ad_place'),
			);
			$menuon = 5;
			break;
		default:
			$menus = array (
				array('分类管理', $forward),
			);
			$menuon = 0;
		break;
	}
} else {
	$menus = array (
		array('专题管理', '?moduleid=11&file=item&specialid='.str_replace('special-', '', $item)),
		array('信息分类', $forward),
	);
	$do->cache = 0;
}
if($submit) {
	$do->update($post);
	dmsg('更新成功', $forward);
} else {
	$lists = $do->get_list();
	include tpl('type');
}
?>